this.name					= "CT_Script";
this.author					= "Thargoid";
this.copyright				= "Creative Commons: attribution, non-commercial, sharealike.";
this.description				= "Captured Thargons";
this.version				= "1.0";

this.startUp = this.reset = function()
	{
	if(missionVariables.CT_thargonCount == null)
		{
		missionVariables.CT_thargonCount = 0;
		}
	}

this.playerBoughtEquipment = function(equipment)
	{
	switch(equipment)
		{
		case "EQ_CT_MINE":
			{
			missionVariables.CT_thargonCount = 5;
			mission.runMissionScreen("CT_instructions", null, null, "CT_thargon", null);
			break;
			}

		case "EQ_MISSILE_REMOVAL":
			{
			if(missionVariables.CT_thargonCount > 0)
				{ // Player gets 5000 back for the removal, but if <5 drones left deduct 1000 per drone
				player.credits -= (1000 * (5 - missionVariables.CT_thargonCount));
 				missionVariables.CT_thargonCount = 0;
				}
			break;
			}

		case "EQ_CT_DRONE_1":
			{
			missionVariables.CT_thargonCount += 1;
			player.ship.removeEquipment("EQ_CT_DRONE_1");
			break;
			}

		case "EQ_CT_DRONE_2":
			{
			missionVariables.CT_thargonCount += 2;
			player.ship.removeEquipment("EQ_CT_DRONE_2");
			break;
			}

		case "EQ_CT_DRONE_3":
			{
			missionVariables.CT_thargonCount += 3;
			player.ship.removeEquipment("EQ_CT_DRONE_3");
			break;
			}

		case "EQ_CT_DRONE_4":
			{
			missionVariables.CT_thargonCount += 4;
			player.ship.removeEquipment("EQ_CT_DRONE_4");
			break;
			}
		}

	if(missionVariables.CT_thargonCount > 5)
		{
		missionVariables.CT_thargonCount = 5;
		}
	}